package chapter19;

import java.util.EnumSet;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/4/2 22:09
 */
public class EnumSets {
    public static void main(String[] args) {
        EnumSet<AlarmPoints> points = EnumSet.noneOf(AlarmPoints.class);
        points.add(AlarmPoints.OFFICE1);
        System.out.println(points);
        points.addAll(EnumSet.of(AlarmPoints.STAIR1, AlarmPoints.OFFICE2, AlarmPoints.KITCHEN));
        System.out.println(points);

        points = EnumSet.allOf(AlarmPoints.class);
        System.out.println(points);

        points = EnumSet.complementOf(points);
        System.out.println(points);
    }
}
